﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using NexTrackDesktop.Controls;
using System.Windows.Controls;
using NexTrackDesktop.NexTrack;

namespace NexTrackDesktop.ViewModels
{
    /// <summary>
    /// This class handles linking to create party views (login & setup)
    /// </summary>
    class PartyViewModel : ViewModelBase
    {
        /// <summary>
        /// This method creates new PartyViewModel and links with view.
        /// </summary>
        public PartyViewModel()
        {
            //FacebookLogin loginView = new FacebookLogin();
            //loginView.LoginCompleted += new Action(showCreate);

            Client.PartyLoaded += new Action(showPartyStart);
            Client.MusicStarting += new Action(showPartyActive);

            showCreate();
        }

        void showPartyActive()
        {
            PartyView = new PartyActive();
        }

        /// <summary>
        /// Changes view to 'PartyStart' view
        /// </summary>
        void showPartyStart()
        {
            PartyView = new PartyStart();
        }

        /// <summary>
        /// Changes view to 'PartyCreate' view
        /// </summary>
        void showCreate()
        {
            PartyView = new PartyCreate();
        }
        UIElement _partyView;
        public UIElement PartyView
        {
            get { return _partyView; }
            set { _partyView = value; NotifyPropertyChanged(() => PartyView); }
        }
    }
}
